﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Commerce/Views/Shared/Backend.Master"
    Inherits="System.Web.Mvc.ViewPage<IEnumerable<SupportTicketViewModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%:"Support tickets".Localize()%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h3 class="title">
        <%: "Support tickets".Localize()%></h3>
    <div class="command clearfix">
    </div>
    <div class="table-container">
        <table>
            <thead>
                <tr>
                <th>
                    <%: "Status".Localize() %>
                </th>
                    <th>
                        <%: "Subject".Localize() %>
                    </th>
                    <th class="common">
                        <%: "EMail".Localize()%>
                    </th>
                    <th class="common">
                        <%:"Date".Localize() %>
                    </th>
                    <th colspan="2" class="action">
                        <%:"Action".Localize() %>
                    </th>
                </tr>
            </thead>
            <tbody>
                <% foreach (var item in this.Model)
                   { %>
                <tr>
                <td>
                    <%: item.Status %>
                </td>
                    <td>
                        <%: item.Subject %>
                    </td>
                    <td>
                        <%: item.Email %>
                    </td>
                    <td>
                        <%: item.CreateDate %>
                    </td>
                    <td class="action">
                        <a href="<%= item.EditUrl %>" class="o-icon edit" title="View">
                            <%:"View".Localize() %></a>
                    </td>
                    <td class="action">
                      <form action='<%= ViewData["delete_action"] %>' method="post">
                        <a href="#" class="o-icon delete delete-link" message='<%= "Are you sure you want to delete this support ticket?".Localize() %>' title="Delete">Delete</a>
                        <input type="hidden" name="Id" value='<%= item.Id %>' />
                        </form>
                    </td>
                </tr>
                <%}%>
            </tbody>
            <tfoot>
                <% var pager = ViewData["Pager"] as PagerModel; %>
                <tr>
                    <th colspan="99">
                        <div class="right">
                            <%: "Show rows:".Localize()%>
                            <select id="pagesize">
                                <option <%: pager.PageSize == 5?"selected=selected":"" %> value="5">5</option>
                                <option <%: pager.PageSize == 10?"selected=selected":"" %> value="10">10</option>
                                <option <%: pager.PageSize == 25?"selected=selected":"" %> value="25">25</option>
                                <option <%: pager.PageSize == 50?"selected=selected":"" %> value="50">50</option>
                            </select>
                        </div>
                    </th>
                </tr>
            </tfoot>
        </table>
        <%: Html.Partial("Pager",pager) %>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <%using (var loader = ClientLoader.RegisterInstance())
      {
          loader.Require("supportticket.index.js");
      } %>
</asp:Content>
